package com.ciaojian.core.service;

import com.ciaojian.core.enums.business.OrderOrderTypeEnum;
import com.ciaojian.core.model.Order;
import com.ciaojian.core.model.ProductGroup;
import com.ciaojian.core.model.User;
import com.ciaojian.core.model.WxPayBase;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 支付Service
 *
 * @author oxiny
 */
public abstract class PayService {
//    public abstract Map<String,Object>

    /**
     * 支付
     *
     * @param productGroup 产品组合
     * @param user         用户
     * @param openId       openId
     * @param wxPay        微信支付Bean
     * @param orderType    订单类型
     * @param request      /
     * @return 预支付ID
     * @throws IllegalAccessException /
     */
    public abstract Map<String, Object> pay(ProductGroup productGroup,
                                            User user,
                                            String openId,
                                            WxPayBase wxPay,
                                            OrderOrderTypeEnum orderType,
                                            HttpServletRequest request) throws IllegalAccessException;

    /**
     * 支付
     *
     * @param order     订单
     * @param openId    openId
     * @param wxPay     微信支付Bean
     * @param orderType 订单类型
     * @param request   /
     * @return 预支付ID
     * @throws IllegalAccessException /
     */
    public abstract Map<String, Object> pay2(Order order,
                                             String openId,
                                             WxPayBase wxPay,
                                             OrderOrderTypeEnum orderType,
                                             HttpServletRequest request) throws IllegalAccessException;
}
